@if ($paginator->getLastPage() > 1)

    <ul class="pagination">
        @if($paginator->getCurrentPage() != 1)
        <li>
            <a href="{{ $paginator->getUrl(1) }}" class="item{{ ($paginator->getCurrentPage() == 1) ? ' disabled' : '' }}">
                <i class="icon left arrow"></i>
                首页
            </a>
        </li>
            @else
            <li>
                <button class="item" disabled="disabled">
                    首页
                </button>
            </li>
        @endif
       {{-- @for ($i = 1; $i <= $paginator->getLastPage(); $i++)--}}
        @if($paginator->getCurrentPage()-1>=1)
            <li class="{{ ($paginator->getCurrentPage() == $paginator->getCurrentPage()-1) ? ' active' : '' }}">
                <a href="{{ $paginator->getUrl($paginator->getCurrentPage()-1) }}" class="item">&#60 上一页</a>
            </li>
            @else
            <li >
                <button class="item" disabled="disabled">
                    &#60 上一页
                </button>
            </li>
        @endif
            @if($paginator->getCurrentPage()-3<1)
                <?php $s=1?>
                @else
                <?php $s=$paginator->getCurrentPage()-3 ?>
            @endif
            @if($paginator->getCurrentPage()+3>$paginator->getLastPage())
                <?php $e=$paginator->getLastPage() ?>
                @else
                <?php $e=$paginator->getCurrentPage()+3 ?>
            @endif
            @for($i=$s;$i<=$e;$i++)
                <li class="{{ ($paginator->getCurrentPage() == $i) ? ' active' : '' }}">
                    <a href="{{ $paginator->getUrl($i) }}" class="item">
                        {{$i}}
                    </a>
                </li>
            @endfor
        @if($paginator->getCurrentPage()+1<=$paginator->getLastPage())
        <li class="{{ ($paginator->getCurrentPage() == $paginator->getCurrentPage()+1) ? ' active' : '' }}">
            <a href="{{ $paginator->getUrl($paginator->getCurrentPage()+1) }}" class="item">
                下一页 &#62
            </a>
        </li>
        @else
            <li class="{{ ($paginator->getCurrentPage() == $paginator->getCurrentPage()+1) ? ' active' : '' }}">
                <button class="item" disabled="disabled">
                    下一页 &#62
                </button>
            </li>
        @endif
       {{-- @endfor--}}
        @if($paginator->getCurrentPage() != $paginator->getLastPage())
        <li>
            <a href="{{ $paginator->getUrl($paginator->getLastPage()) }}" class="item{{ ($paginator->getCurrentPage() == $paginator->getLastPage()) ? ' disabled' : '' }}">
                末页
                <i class="icon right arrow"></i>
            </a>
        </li>
            @else
            <li class="{{ ($paginator->getCurrentPage() == $paginator->getCurrentPage()+1) ? ' active' : '' }}">
                <button class="item" disabled="disabled">
                    末页
                </button>
            </li>
            @endif
    </ul>

@endif